#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QPushButton>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QVBoxLayout* layout = new QVBoxLayout(ui->wDisplay);

    BPageSwitchContainer* pageSwitchContainer = new BPageSwitchContainer(ui->wDisplay);
    layout->addWidget(pageSwitchContainer);
    ui->wDisplay->setLayout(layout);


    BPageSwitch* page1 = new BPageSwitch(pageSwitchContainer);
    BPageSwitch* page2 = new BPageSwitch(pageSwitchContainer);
    BPageSwitch* page3 = new BPageSwitch(pageSwitchContainer);

    pageSwitchContainer->addPage(page1);
    pageSwitchContainer->addPage(page2);
    pageSwitchContainer->addPage(page3);

    QLabel* label = new QLabel(page1);
    label->setText("Page1");
    label->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
    page1->layout()->addWidget(label);

    QLabel* label2 = new QLabel(page2);
    label2->setText("Page2");
    label2->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
    page2->layout()->addWidget(label2);

    QLabel* label3 = new QLabel(page3);
    label3->setText("Page3");
    label3->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
    page3->layout()->addWidget(label3);

    pageSwitchContainer->setCenterPage(1);

}

MainWindow::~MainWindow()
{
    delete ui;
}

